#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>

int main()
{
    int l = 0;
    int w = 0;
    int C = 0;
    int S = 0;
    scanf("%d%d", &l, &w);
    C = 2 * (l + w);
    S = l * w;
    printf("C = %d\n", C);
    printf("S = %d\n", S);

    return 0;
}